A1 = readmatrix('CPGE_Pol_30K.csv')

% note: the angle should be flipped, as the cryostat was rotated by 45 deg.
x1 = A1(1:91,1)/360*2*pi
y1 = A1(1:91,2)*1e12+0.05
z1 = smoothdata(y1, "movmedian",3)

a =  -0.01581
b =  -0.01145
c = 0.03833
d = 1.462

f1 = a*sin(4*x1)+b*cos(4*x1)+c*sin(2*x1)+d

hold on

plot(x1,f1,'Linewidth',2,'Color',[0 0 0.8])
scatter(x1,z1,10,[0 0 0.8],'filled')
xlabel('Polarization')
ylabel('Photocurrent [pA]')
xlim([0, pi])
ylim([1.35,1.55])
xticks(0:pi/4:pi)
yticks(1.4:0.1:1.5)
xticklabels({'0','pi/4','pi/2','3pi/4','pi'})
%set(gca,'XMinorTick','on','YMinorTick','on')
set(gca,'box','on','Xcolor',[0 0 0],'Ycolor',[0 0 0])
hold off

set(gcf,'Position',[0, 0, 197, 110])